package view.rules;

import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

import net.miginfocom.swing.MigLayout;

public class ModifyTypePanel extends JPanel{
	
	ButtonGroup radioButtonGroup;
	private JPanel modifyTypePanel;
	public JRadioButton prefixRButton;
	public JRadioButton suffixRButton;
	private JCheckBox redupCheBox;
	public JRadioButton infixRButton;
	public JRadioButton circumfixRButton;
	public JRadioButton newTransRButton;
	public JRadioButton addWordRButton;
	private JLabel redupLabel;	
	
	public ModifyTypePanel(){
		setLayout(new MigLayout());
		initComponent();
		addComponent();
	}
	
	private void initComponent(){
		
		modifyTypePanel = new JPanel();
		modifyTypePanel.setLayout(new MigLayout());
		modifyTypePanel.setBorder(BorderFactory.createTitledBorder("Type of Modification"));
		
		prefixRButton = new JRadioButton("Prefix");
		prefixRButton.setSelected(true);
		suffixRButton = new JRadioButton("Suffix");
		infixRButton = new JRadioButton("Infix");
		circumfixRButton = new JRadioButton("Circumfix");
		newTransRButton = new JRadioButton("New Translation");
		addWordRButton = new JRadioButton("Add Word");
		redupCheBox = new JCheckBox();
		redupLabel = new JLabel("Reduplication");
		
		radioButtonGroup = new ButtonGroup();
		radioButtonGroup.add(prefixRButton);
		radioButtonGroup.add(suffixRButton);
		radioButtonGroup.add(infixRButton);
		radioButtonGroup.add(circumfixRButton);
		radioButtonGroup.add(newTransRButton);
		radioButtonGroup.add(addWordRButton);
	}
	
	private void addComponent(){
		
		addModifyType();
		add(modifyTypePanel);
		
	}
	
	private void addModifyType(){
		
		modifyTypePanel.add(prefixRButton);
		modifyTypePanel.add(suffixRButton);
		modifyTypePanel.add(infixRButton);
		modifyTypePanel.add(circumfixRButton);
		modifyTypePanel.add(newTransRButton);
		modifyTypePanel.add(addWordRButton);
		modifyTypePanel.add(redupCheBox);
		modifyTypePanel.add(redupLabel);
		
	}
}
